''' Mission 9 - Game Spinner Traversal lesson ''' from codex import * import random from time import sleep def show_random_arrow(): arrow = random.randrange(8) display.show(pics.ALL_ARROWS[arrow]) # - new function with for loop def spin_animation(count): delay = 0.0 for number in range(count): index = number % len(pics.ALL_ARROWS) display.show(pics.ALL_ARROWS[index]) delay = delay + 0.005 sleep(delay) while True: if buttons.is_pressed(BTN_A) or buttons.is_pressed(BTN_B): spin_animation(30) show_random_arrow()